#/bin/bash

echo "`echo $1`" # remove leading and trailing whitespace
refs=$1
#${varible##*string}	从左向右截取最后一个string后的字符串
#${varible#*string}	从左向右截取第一个string后的字符串
#${varible%%string*}	从右向左截取最后一个string后的字符串
#${varible%string*}	从右向左截取第一个string后的字符串
refs=${refs##* }	# remove leading whitespace characters
refs=${refs% *}	        # remove trailing whitespace characters
echo "$refs"

echo "test if statement"
file=filename
if [ -f $filename ];then # see if filename exists.
echo $file exists
fi

if [ ! -f $filename ] # see if filename exists.
then
echo $file does not exist
fi

